import { defineConfig } from '@vben/vite-config'
// {                                                                                                                          14:46:25
//   mode: string,
//   command: string,
//   isSsrBuild: boolean,
//   isPreview: boolean
// }
export default defineConfig(async (res) => {
    return {
        application: {},
        vite: {
            // build: {
            //     outDir: `build-dist/${res?.mode || 'production'}`
            // },
            optimizeDeps: {
                include: [
                    'echarts/core',
                    'echarts/charts',
                    'echarts/components',
                    'echarts/renderers',
                    'qrcode',
                    'ant-design-vue/es/locale/zh_CN',
                    'ant-design-vue/es/locale/en_US'
                ]
            },
            server: {
                proxy: {
                    '/api': {
                        changeOrigin: true,
                        rewrite: (path) => path.replace(/^\/api/, ''),
                        // mock代理目标地址
                        target: 'http://34.29.16.102:8001',
                        ws: true
                    }
                }
            }
        }
    }
})
